<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<video id="live-record-player" autoplay x5-video-player-type="h5" playsinline>
  <!--<source src="https://www.runoob.com/try/demo_source/mov_bbb.mp4" type="video/mp4" />-->
  <source src="http://192.168.1.197:18443/artemis-record/1711332758336.mp4" type="video/mp4" />
</video>

<button id="playing">播放</button>
<button id="paused">暂停</button>
<script>
const player = document.querySelector('#live-record-player');
const $playing = document.querySelector('#playing');
const $paused = document.querySelector('#paused');

player.load()



$playing.oncanplay = () => {
  // console.log(player.paused)
}

$playing.addEventListener('canplay', () => {
  // console.log(player.paused)
}, false)


$playing.addEventListener('click', () => {
  // console.log(player.paused)
  if (player.paused) {
    player.play()
  }
}, false)

$paused.addEventListener('click', () => {
  // console.log(player.paused)
  if (!player.paused) {
    player.pause()
  }
}, false)

</script>
</body>
</html>
